Skip to content

Update NumPy patching#170

Open
ndgrigorian wants to merge 4 commits intomainfrom
update-umath-patching
Open

Update NumPy patching#170
ndgrigorian wants to merge 4 commits intomainfrom
update-umath-patching

Conversation

@ndgrigorian
Copy link
Collaborator

This PR

  • Adds safety checks to patching
  • Add warnings related to multi-threaded programs
  • Implement _GlobalPatch wrapper class which implements patching globally
  • Rename _patch module to _patch_numpy
  • Rename patching functions
  • Aligns with mkl_fft and mkl_random patching interfaces

@ndgrigorian ndgrigorian force-pushed the update-umath-patching branch 4 times, most recently from c05279b to 1a4529a Compare March 10, 2026 04:19
@ndgrigorian ndgrigorian marked this pull request as ready for review March 10, 2026 04:33
@ndgrigorian
Copy link
Collaborator Author

@antonwolfy @jharlow-intel
the patch update here is ready for review

@ndgrigorian ndgrigorian force-pushed the update-umath-patching branch from 1a4529a to e40ef5a Compare March 10, 2026 05:11
@@ -193,11 +193,11 @@ def test_reduce_complex(func, dtype):


def test_patch():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add more testing to verify:

  • reference counting behavior (nested contexts)
  • new error handling paths
  • multi-threaded scenarios that trigger warnings
  • verbose parameter

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should wait on multi-threaded scenarios for free-threading support (more convenient/aligned with what we're interested in supporting), but the rest I will add

* Add safety checks to patching
* Add warnings related to multi-threaded programs
* Implement _GlobalPatch wrapper class which implements patching globally
* Rename _patch module to _patch_numpy
* Rename patching functions
@ndgrigorian ndgrigorian force-pushed the update-umath-patching branch from a6a0c96 to 711df0e Compare March 10, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants